﻿using System;
using System.Linq;



class Program
{
    static int ReverseDigits(int number)
    {
        char[] digits = number.ToString().ToCharArray();
        Array.Reverse(digits);

        string returnValue = "";
        foreach (var digit in digits)
        {
            returnValue += digit.ToString();
        }
        return int.Parse(returnValue);
    }

    static void Main()
    {
        int number = int.Parse(Console.ReadLine());

        Console.WriteLine(ReverseDigits(number));
    }
}
